<div class="top"><?php $self->renderChild('toolbar'); ?></div>

<?php $posts = $self->getPostCollection(); ?>
<?php if (count($posts) > 0): ?>
<ul class="post-list">
	<?php foreach($posts as $p): ?>
	<li class="item">
		<div class="post-heading">
			<p class="post-date">
				<?php $time = strtotime($p->getUpdateTime()); ?>
				<strong><?php echo date('d', $time) ?></strong>
				<em><?php echo date('F', $time) ?></em>&nbsp;-&nbsp;<span><?php echo date('Y', $time) ?></span>
			</p>
			<h1 class="post-title">
				<a href="<?php echo App::url('post/view/id/'.$p->getId()) ?>"><?php echo $p->getTitle() ?></a>
			</h1>
		</div>

		<div class="post-additional">
			<div class="rating-box"><div style="width:<?php echo $p->getRating()*20; ?>%" class="rating"></div></div>
			<a href="<?php echo App::url('admin/post/edit/id/'.$p->getId()) ?>" target="_blank" style="text-decoration: none"><i class="icon-edit"></i>&nbsp;</a>
		</div>

		<p class="post-desc"><?php echo nl2br($p->getDescription()) ?></p>

		<div class="post-content"><?php echo $self->modifyContent($p->getContent()) ?></div>
	</li>
	<?php endforeach ?>
</ul>
<div class="bottom"><?php $self->renderChild('toolbar'); ?></div>
<script type="text/javascript">
	decorateList('.posts-list');
	$(".post-list img").unveil(150);
</script>

<?php else: ?>
<p class="empty-msg">There are no posts matching the selection.</p>
<?php endif ?>

